{% extends "base.phtml" %}

{% block content %}
<div class="box">
    <div class="box-header">
        <h3 class="box-title">
            <a href="edit" class="btn btn-sm btn-info">新增</a>
        </h3>
        <div class="box-tools">
         <!--   <form class="input-group input-group-sm" action="" method="get" style="width: 150px;">
                <input type="text" name="code" value="{{code}}" class="form-control pull-right" placeholder="搜索代号">

                <div class="input-group-btn">
                    <button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button>
                </div>
            </form>-->
        </div>
    </div>
    <div class="box-body">
        <table class="table table-bordered  table-hover">
            <tr>
                <th class="col-xs-3">奖励描述</th>
                <th class="col-xs-1">奖励条件</th>
                <th class="col-xs-2">奖励天数</th>
                <th class="col-xs-2">状态</th>
                <th class="col-xs-2">操作</th>
            </tr>

            {%for k,v in list%}
            <tr>
                <td>{{v.attrdesc}}</td>
                <td>{{v.attrcode}}</td>
                <td>{{v.attrval}}</td>
                <td>
                    {%if v.enable%}
                    <label class="label label-success">可用</label>
                    {%else%}
                    <label class="label label-warning">不可用</label>
                    {%endif%}
                    {% if v.stime>nowtime or v.etime < nowtime%}
                        <label class="label label-danger">不在有效时间内</label>
                    {%endif%}
                </td>
                <td>
                    <a href="edit?id={{v.id}}" class="btn  btn-xs btn-primary">编辑</a>
                    {%if !v.enable%}
                    <a data-url="switch?id={{v.id}}&enable=1" class="btn btn-xs btn-info update">开启</a>
                    {%else%}
                    <a data-url="switch?id={{v.id}}&enable=0" class="btn btn-xs btn-warning update">关闭</a>
                    {%endif%}
                    <a data-url="delete?id={{v.id}}" class="btn btn-xs btn-danger delete">删除</a>
                </td>
            </tr>
            {%endfor%}
        </table>
    </div>

    <div class="box-footer clearfix">
        {{pageHtml}}
    </div>
</div>
<div class="modal fade" id="modal-default">
    <div class="modal-dialog" style="width: 90%;">
        <div class="modal-content">

        </div>
    </div>
</div>

{% endblock %}


{% block extjs %}

{%endblock%}